package org.wendu.wdoa.common;

public enum LeaveStatusEnum {

    To_SUBMIT(0,"待提交"),
    To_EXAMINE(1,"待审批"),
    REJECTED(2,"已驳回"),
    PASS(3,"已通过"),
    BACK(4,"已销假");

    private Integer code;
    private String name;

    private LeaveStatusEnum(Integer code,String name){
        this.code=code;
        this.name=name;
    }

    public static String getName(Integer code){
        LeaveStatusEnum[] values = LeaveStatusEnum.values();
        for (LeaveStatusEnum value:values){
            if (value.code.equals(code)){
                return value.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public Integer getCode() {
        return code;
    }
}

